<template>
	<view>
		<view class="header">
			<view class="blue-bg">
				<view class="box">
					<view class="box-hd">
						<view class="avator">
							<image style="width: 100%; height: 100%;" src="../../static/images/userCenter/person.png">
							</image>
						</view>
						<view class="account_name">{{ account }}</view>
					</view>
					<view class="box-bd">
						<view class="item">
							<view class="icon">
								<image style="width: 100%; height: 100%;"
									src="../../static/images/userCenter/taskProcess.png"></image>
							</view>
							<view class="text">任务处理</view>
							<span class="iconNumber">{{ taskCount }}</span>
						</view>
						<view class="item">
							<view class="icon">
								<image style="width: 100%; height: 100%;"
									src="../../static/images/userCenter/dailyPatrol.png"></image>
							</view>
							<view class="text">日常巡逻</view>
							<span class="iconNumber">{{ partolCount }}</span>
						</view>
						<view class="item">
							<view class="icon">
								<image style="width: 100%; height: 100%;"
									src="../../static/images/userCenter/manualAlarm.png"></image>
							</view>
							<view class="text">手动告警</view>
							<span class="iconNumber">{{ alarmCount }}</span>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="list-content">
			<view class="list">
				<view class="li noborder" @click="checkCard">
					<view class="icon">
						<image src="../../static/images/userCenter/card.png"></image>
					</view>
					<view class="text">我的名片</view>
					<image class="to" src="../../static/images/userCenter/to.png"></image>
				</view>
			</view>
			<view class="list">
				<view class="li " @click="aboutInfo">
					<view class="icon">
						<image src="../../static/images/userCenter/about.png"></image>
					</view>
					<view class="text">版本说明</view>
					<image class="to" src="../../static/images/userCenter/to.png"></image>
				</view>
			</view>
			<view class="list">
				<view class="li noborder" @click="systemSetting">
					<view class="icon">
						<image src="../../static/images/userCenter/set.png"></image>
					</view>
					<view class="text">系统设置</view>
					<image class="to" src="../../static/images/userCenter/to.png"></image>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		onShow: function() {},
		data() {
			return {
				account: '路飞',
				taskCount: 0,
				partolCount: 0,
				alarmCount: 0
			};
		},
		// computed: {
		// 	...mapGetters(['account'])
		// },
		methods: {
			// 我的名片
			checkCard() {
				uni.navigateTo({
					url: '../userCenter/userCard'
				});
			},
			// 版本说明
			aboutInfo() {
				uni.navigateTo({
					url: '../userCenter/imprint'
				});
			},
			// 系统设置
			systemSetting() {
				uni.navigateTo({
					url: '../userCenter/systemConfig'
				});
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f1f1f1;
		font-size: 30rpx;
	}

	.header {
		background: #fff;
		height: 410rpx;

		.blue-bg {
			width: 100%;
			height: 210rpx;
			padding-top: 100rpx;
			background-color: #447aff;
		}
	}

	.box {
		width: 650rpx;
		height: 300rpx;
		border-radius: 20rpx;
		margin: 0 auto;
		background: #fff;
		box-shadow: 0 5rpx 20rpx 0rpx rgba(0, 0, 150, .2);

		.box-hd {
			display: flex;
			flex-wrap: wrap;
			flex-direction: row;
			justify-content: center;

			.avator {
				width: 150rpx;
				height: 150rpx;
				background: #fff;
				border: 5rpx solid #fff;
				border-radius: 50%;
				margin-top: -80rpx;
				overflow: hidden;

				img {
					width: 100%;
					height: 100%;
				}
			}

			.account_name {
				width: 100%;
				text-align: center;
				padding-bottom: 20rpx;
				font-size: 35rpx;
				font-weight: 600;
			}
		}

		.box-bd {
			display: flex;
			flex-wrap: nowrap;
			flex-direction: row;
			justify-content: center;

			.item {
				flex: 1 1 auto;
				display: flex;
				flex-wrap: wrap;
				flex-direction: row;
				justify-content: center;
				border-right: 1px solid #f1f1f1;
				margin: 15rpx 0;

				&:last-child {
					border: none;
				}

				.icon {
					width: 60rpx;
					height: 60rpx;

					img {
						width: 100%;
						height: 100%;
					}
				}

				.text {
					width: 100%;
					text-align: center;
					margin-top: 10rpx;
				}

				.iconNumber {
					width: 45rpx;
					height: 30rpx;
					border-radius: 20rpx;
					background-color: red;
					font-size: 18rpx;
					color: white;
					text-align: center;
					position: relative;
					top: -120rpx;
					left: 35rpx;
				}
			}
		}
	}

	.list-content {
		background: #fff;
	}

	.list {
		width: 100%;
		border-bottom: 15rpx solid #f1f1f1;
		background: #fff;

		&:last-child {
			border: none;
		}

		.li {
			height: 100rpx;
			padding: 0 4%;
			border-bottom: 1px solid rgb(243, 243, 243);
			display: flex;
			align-items: center;

			&.noborder {
				border-bottom: 0
			}

			.icon {
				flex-shrink: 0;
				width: 50rpx;
				height: 50rpx;

				image {
					width: 50rpx;
					height: 50rpx;
				}
			}

			.text {
				padding-left: 20rpx;
				width: 100%;
				color: #666;
			}

			.to {
				flex-shrink: 0;
				width: 38rpx;
				height: 38rpx;
			}
		}
	}
</style>
